﻿namespace EFS.RC.ConversationBrowser.Tools
{
	/// Used for the statuses message list
	[System.Xml.Serialization.XmlType("BaseResultItems")]
	public class ResultItems<T>
	{
		/// Public constructor (used especially for deserialization)
		public ResultItems()
		{
			// ensure is never null
			Items = new T[0];
		}

		/// Explicit constructor
		public ResultItems(T[] items)
		{
			// ensure is never null
			Items = new T[0];

			// test array
			if (null != items && items.Length > 0)
			{
				Items = new T[items.Length];
				items.CopyTo(Items, 0);
			}
		}

		/// Explicit constructor
		public ResultItems(System.Collections.Generic.ICollection<T> collection)
		{
			// init 
			Items = new T[collection.Count];

			// copy
			collection.CopyTo(Items, 0);
		}

		/// Property Items: Get
		public T[] Items { get; set; }
	}

}